package com.girlbook.dao;

import java.util.List;

import net.paoding.rose.jade.annotation.DAO;
import net.paoding.rose.jade.annotation.SQL;
import net.paoding.rose.jade.annotation.SQLParam;

import com.girlbook.model.Article;

@DAO
public interface ArticleDAO
{
	@SQL("insert into t_gb_article (title,summary,content,create_user,create_time) values (:art.title,:art.summary,:art.content,:art.createUser,:art.createTime)")
	public void save(@SQLParam("art") Article article);

	@SQL("select * from t_gb_article where id = :1")
	public Article queryById(int artId);

	@SQL("select * from t_gb_article where is_delete = 0 order by create_time desc limit :1,:2")
	public List<Article> queryListByPage(int from, int to);

	@SQL("select count(id) from t_gb_article where is_delete = 0")
	public int queryTotal();
}
